package hzjbbis.framework.workflow.util;

import hzjbbis.framework.workflow.service.IServiceLocator;
import hzjbbis.framework.workflow.service.impl.SpringServiceLocator;

public class Global {
    protected static IServiceLocator serviceLocator;

    public static IServiceLocator getServiceLocator() {
        if (serviceLocator == null) {
            serviceLocator = new SpringServiceLocator(ContextUtils
                    .getInstance().getContext());
        }
        return serviceLocator;
    }

    public Object getService(String serviceName) {
        return serviceLocator.getService(serviceName);
    }

    public Object getBean(String beanName) {
        return serviceLocator.getBean(beanName);
    }

}
